<extend name="public/base"/>
<block name="body">
<style>
.alert{
	line-height: 40px;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
	padding:10px;
	margin-bottom:10px;
	
}
.alert-warning{
	background-color: #ffede7;
    color: #787878;
}
.alert-info{
	background-color: #f2f2f2;
    color: #787878;
}
.text-success{color:#44b549}
h3,h4{padding:10px 0; line-height:25px; height:25px; clear:both}
</style>
<div class="layui-card qn-header">
	<div class="layui-breadcrumb">
		<a href="">首页</a>
		<a href=""><cite>核心自动升级 - 更新源码</cite></a>
	</div>
</div>
<div class="layui-fluid">
	<div class="layui-card">
	<div class="layui-card-body">

<div class="portlet">
	<div class="alert alert-info">
		<p>当前需要升级的版本：<strong>{$nextVersion.name}</strong></p>

		<p>当前的系统版本号：<strong>{$currentVersion.name}</strong></p>
	</div>
	<div class="portlet-body">
		<h3><strong class="text-success">1.下载更新包，获取更新文件列表  &gt;  2.本地文件对比  &gt;  3.代码升级 </strong>  &gt;  4.数据库升级  &gt;  升级完成</h3>
		<div id="message" style="border: 1px solid #ccc;padding: 20px;height: 243px;overflow: auto">

		</div>
		<h4>本次更新涉及的文件：</h4>
		<div id="file" style="border: 1px solid #ccc;padding: 20px;height: 250px;overflow: auto">

		</div>

		<h4>备份文件存放位置：</h4>
		<p class="alert alert-warning">
		   {$backup_path}
		</p>

		<a id="compare_btn" disabled="disabled" href="{:U('updb')}" class="layui-btn layui-btn-sm">文件覆盖完成，导入数据库</a>
	</div>
</div>
</div>
</div>
</div>

<script>
	function writeFile($data) {
		$('#file').append('<div><i class="icon-file"></i> '+$data+'</div>');
	}
	function writeMessage($data) {
		$('#message').append($data);
	}
	function replaceMessage($data) {
		$('#message').children().last().remove();
		$('#message').children().last().remove();
		$('#message').append($data);
	}
	var progress = {
		'show': function () {
			$('#progress').parent().show();
		},
		'setValue': function ($value) {
			$('#progress').css('width', $value);
		},
		'hide': function () {
			$('#progress').parent().hide();
		}
	};
	function enable(){
		$('#compare_btn').removeAttr('disabled','');
	}
</script>
</block>